package com.ying.dao.order;

import com.ying.po.order.Express;
import com.ying.po.order.Orange;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;
import java.util.Optional;

public interface OrangeRepository extends JpaRepository<Orange, Integer> {

    @Query(value = "select * from t_orange where IS_DELETE=0", nativeQuery = true)
    public Page<Orange> getOrangePageIsNotDeleted(Pageable pageable);

    @Query(value = "select * from t_orange where is_delete=0 and id=?1", nativeQuery = true)
    public Optional<Orange> findByIdAndIsNotDelete(Integer id);
}
